<template>
  <el-card class="box-card">
    <div class="text item">
      <el-select v-model="newService" placeholder="请选择">
        <el-option
          v-for="item in list"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
    </div>
  </el-card>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default() {
        return []
      }
    },
    value: {
      type: String,
      required: false,
      default() {
        return ''
      }
    }
  },
  data() {
    return {
      activeNames: ['1'],
      newService: ''
    }
  },
  watch: {
    newService(newValue) {
      console.log('选择的改变,', newValue)
      this.$emit('input', newValue)
    },
    value: {
      handler() {
        this.newService = this.value
      },
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
  .el-select{
    width: 100%;
  }
</style>
